﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using KraveEntities;
using KraveDAL;

public partial class login : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        LoginBO lb = new LoginBO();
        LoginDAL ld = new LoginDAL();
        int id = 0;
        lb.Id =  Convert.ToInt32(TextBox1.Text);
        lb.Password = TextBox2.Text;

        int rValue = ld.Check_login(lb ,ref id);
        if (rValue == 1)
        {
            Response.Redirect("adminViewEvent.aspx?="+id+"");
        }
        else if (rValue == 2)
        {
            Response.Redirect("clientViewEvent.aspx?id="+id+"");
        }
        else if (rValue == 3)
        {
            Response.Redirect("errorpage.aspx");
        }

    }
}